<?php
include("cls/cls_usuarios.php");
session_start();
$adminName=$_POST["adminName"];
$contrasenha=$_POST["password"];
$admin = new cls_usuarios ();
$var=$admin->login($adminName,$contrasenha);

while($mostrar = mysql_fetch_array($var)){
$name=$mostrar['admin_name'];
$pass=$mostrar['password'];
$user_id=$mostrar['user_id'];
echo "impresion del usuario".$user_id;
}

if($adminName==$name && $contrasenha==$pass){

$_SESSION['user']='$user_id';
$_SESSION['create_session']='user';
$admin->cambia_estado ($_SESSION['user'],'o');
/*
session_register($create_session);
session_register($user_id);
session_register($user_id);
session_register($email);*/

echo"
<script>
document.write(window.location='home.php');
</script>";
echo "sientra";
}
else
{
echo"
<script>
document.write(window.location='index.php');
</script>";
}
?>